/*
**  File: AquaCalc.h
*/
int main( int argc, char *argv[] );
Distval *DoAverage( Distinfl *dist_infl, Distvall *dist_vall,
	            const int dist_count, const int struc_count,
		    const int av_how, const int nmono );
void DoErrors( const DistinfTyp ftype, Distinf *dist_inf, Distrst *dist_rst, Distval *dist_val,
	       const int dist_count, const int struc_count, Mol *molptr,
	       Model *models, const float lim, Qtyp qto, Qtyp qts, Filnam dval_filnam );
void InitSTARFile( Qtyp qts, FILE *fp );
void DoInfo( const DistinfTyp ftype, Distinf *dist_inf, Distrst *dist_rst,
             const int dist_count,
             Mol *molptr, Qtyp qto, Qtyp qts, Filnam dval_filnam );
Disterr *CalcDistError( Violrec *viol_rst, Violrec *viol_str, Violrec **viol_res_list,
                        Distinf *dist_inf, Distrst *dist_rst, Distval *dist_val,
			const int dist_count, const int struc_count, Mol *molptr,
			const float lim );
void CalcDistErrorT( Violrec **viol_typ_list, Disterr *dist_err,
                     Distinf *dist_inf, const int typ_count,
	             const int dist_count, const int struc_count, Mol *molptr,
		     const float lim );
void CalcDistErrorT2( Violrec **viol_typ_list, Disterr *dist_err,
                     int *typA, int *typB, const int typ_count,
	             const int dist_count, const int struc_count, Mol *molptr,
		     const float lim );
void WriteDistError( Violrec *viol_rst, Violrec *viol_str, Violrec *viol_res,
                     Distinf *dist_inf, Distrst *dist_rst, Distval *dist_val,
		     Disterr *dist_err, const int dist_count, const int struc_count,
		     Mol *molptr, Model *models, const float lim, FILE *fp);
void WriteDistErrorT( Violrec *viol_typ, const int typ_count, const int struc_count,
		     Model *models, FILE *fp );
void WriteDistErrorT2( Violrec *viol_typ, int *typ_list,
                     const int typ_count, const int struc_count,
		     Model *models, FILE *fp );
void WriteSTARDistError( Violrec *viol_str, Violrec *viol_typ, const int typ_count,
                         const int struc_count, Qtyp qts, FILE *fp );
void FreeDistError( Violrec *viol_rst, Violrec *viol_str,
                    Violrec **viol_res_list, const int struc_count );
void FreeDistError2( Violrec **viol_x_list, const int struc_count );
Violsumm *NewViolsumm( int count );
void UpdViolsumm( float *e, Violsumm *v_upp, Violsumm *v_low, Violsumm *v_lim,
                  const float lim );
void  AvRmsViolsumm( Violsumm *v, float *av, float *rms, const Boolean numViol );
void  RmsViolsumm2( Violsumm *v, float *av, float *rms, const Boolean numViol );
void CombViolsumm( Violsumm *v_upp, Violsumm *v_low, Violsumm *v_comb );
void WriteViolsumm( FILE *fp, Violsumm *v_upp, Violsumm *v_low, Violsumm *v_lim );
void WriteViolsummAv( FILE *fp, Violsumm *v_upp, Violsumm *v_low, Violsumm *v_lim );
void WriteHdrViolsumm( FILE *fp );
void WriteHdrViolsummAv( FILE *fp );
void CalcDrstContent( Drstcont **cont_res, Drstcont **cont_typ,
                      Distinf *dist_inf, Distrst *dist_rst,
                      const int dist_count, const int dtyp_count, Mol *molptr );
void WriteDrstContent( Drstcont *cont_res, Drstcont *cont_typ,
                       const int dist_count, const int dtyp_count,
		       Mol *molptr, FILE *fp );
void WriteSTARDrstContent( Drstcont *cont_typ,
                           const int dist_count, const int dtyp_count,
		           Qtyp qts, FILE *fp );
Drstcont *NewDrstcont( int count );
void UpdDrstcont( Drstcont *cont, Distrst *rst );
void WriteDrstcont( FILE *fp, Drstcont *cont );
void WriteHdrDrstcont( FILE *fp );
void WriteDstTyp( FILE *fp, int typ );
void UpdateDistInf( Distinf *dist_inf, int dist_count, Mol *old_mol, Mol *new_mol,
                    int *atom_map, int *residue_map );
void RangeDistLists( DistdataList *inf_list, Distinf *dist_inf, Distrst **dist_rst,
                     DistdataList *val_list, int *dist_count, int *tot_dist_count,
		     int *a_count, Model **models,
		     int *new_struc_count, const int struc_count, Mol *molptr );
void ClassifyRestraints( Distinf *dist_inf, int dist_count, Atom *atoms );
void ShowDistl( Distinfl *dist_inf, Distvall *dist_val, Distrst *dist_rst,
                const int dist_count, Mol *molptr, const int struc_count );
